package com.vivz.guess.what.type;

public enum Position {

	FIRST(1), SECOND(2), THIRD(3), FOURTH(4);

	private final int position;
	private boolean confirmed = false;

	private Position(final int position) {
		this.position = position;
	}

	public int getPosition() {
		return position;
	}

	public static Position getInstance(final int position) {

		switch (position) {
		case 1:
			return FIRST;
		case 2:
			return SECOND;
		case 3:
			return THIRD;
		case 4:
			return FOURTH;
		default:
			return null;
		}
	}

	public boolean isConfirmed() {
		return confirmed;
	}

	public void setConfirmed(final boolean confirmed) {
		this.confirmed = confirmed;
	}

	/**
	 * If the position is confirmed it'll add an asterisk besides the actual position.
	 */
	@Override
	public String toString() {
		return position + (confirmed ? "*" : "");
	}

}
